import Vue from 'vue'
import SlideVerify from 'vue-monoplasty-slide-verify'
import App from './App.vue'
import './registerServiceWorker'
import router from './router'
import store from './store'
import ElementUI from 'element-ui'
import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css'
import 'element-ui/lib/theme-chalk/index.css'
import { isLogin } from '@/utils/api'
import BaiduMap from 'vue-baidu-map'
import AMap from 'vue-amap'
import OrderNull from '@/components/OrderNull.vue'
import Tips from '@/components/Tips.vue'
AMap.initAMapApiLoader({
  key: 'c799c2a58f9fd1de77bb2a85a3218a0f',
  plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView',
    'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor',
    'AMap.CircleEditor', 'AMap.Geolocation']
})
Vue.use(AMap)
Vue.use(VueAwesomeSwiper /* { default global options } */)
Vue.use(BaiduMap, {
  ak: 'sL39fIQ8s3Cyb0daeVInn9jxHtwld409'
})
Vue.config.productionTip = true
Vue.use(SlideVerify)
Vue.use(ElementUI)
Vue.component('order-null', OrderNull)
Vue.component('ti-ps', Tips)
Vue.mixin({
  computed: {
    uploadURL () {
      return 'https://niwotagood.cn/upload'
    }
  },
  methods: {
    loginStore () {
      return new Promise(resolve => {
        isLogin().then(res => {
          resolve(res)
        })
      })
    }
  }
})
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
